package me.numark.model;

import android.util.Log;

import com.google.gson.Gson;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by tian on 14-9-26:上午9:49.
 */
public class News extends BaseModel{

    public String c_type;

    public int escape_status;

    public int read_num;

    public boolean is_my_mark;

    public int topic_num;

    public int mark_num;

    public float star;

    public User by_user;

    public String from_str;

    public String subtitle;

    public String url;

    public String from_to;

    public String create;

    public String face_img;

    public long create_timestamp;

    public int type;

    public boolean is_like;

    public int share_count;

    //public FeedTag[] labels;


    public int label_num;

    public Date getDate() {
        return new Date(create_timestamp * 1000);
    }

    public String getDay() {
        try {
            Long time = Long.parseLong("create_timestamp");
            long day = time / 24 / 3600;
            return Long.toString(day);
        } catch (Exception e) {

        }
        return "";
    }

    @Override
    public String toString() {
        Gson gson = new Gson();
        return gson.toJson(this);
    }
}
